package cn.cheln.explorer.beans;

import android.content.Context;
import cn.cheln.support.images.MimeTypeMap;
import java.io.File;
import java.util.Iterator;
import java.util.List;

public class FileInfoUtil
{
  static FileInfo fileInfo;

  public static List<? extends FileInfo> getFileInfos(List<FileInfo> paramList, Class<? extends FileInfo> paramClass, List<File> paramList1, Context paramContext)
  {
    if (paramList == null)
      throw new IllegalStateException("fileinfos is null");
    if (paramList1 == null)
      return paramList;
    Iterator localIterator = paramList1.iterator();
    while (true)
    {
      if (localIterator.hasNext());
      File localFile = (File)localIterator.next();
      if (localFile == null)
        continue;
      paramList.add(FileInfo.hasFileInfo(paramClass, localFile, paramContext));
    }
  }

  public static List<? extends FileInfo> getFileInfos(List<FileInfo> paramList, Class<? extends FileInfo> paramClass, File[] paramArrayOfFile, Context paramContext, String paramString)
  {
    int i;
    int j;
    if (paramList == null)
      throw new IllegalStateException("fileinfos is null");
    if (paramArrayOfFile == null);
    do
    {
      return paramList;
      i = paramArrayOfFile.length;
      label27: j = 0;
    }
    while (j >= i);
    File localFile = paramArrayOfFile[j];
    if (localFile == null);
    while (true)
    {
      ++j;
      break label27:
      if ((!(localFile.isDirectory())) && (paramString != null) && (((!(localFile.isFile())) || (!(paramString.equals(FileUtil.getRealLowerCaseExtension(localFile.getName())))))))
        continue;
      if ((paramClass == null) && (isFileType(new FileInfo(localFile.getAbsolutePath())) == FileType.Audio))
        paramList.add(FileInfo.hasFileInfo(MusicInfo.class, localFile, paramContext));
      paramList.add(FileInfo.hasFileInfo(paramClass, localFile, paramContext));
    }
  }

  public static FileType isFileType(FileInfo paramFileInfo)
  {
    if (paramFileInfo.getType() == null)
      paramFileInfo.buildExtension();
    if (paramFileInfo.getType().equalsIgnoreCase("apk"))
      return FileType.Apk;
    if (paramFileInfo.getType().equalsIgnoreCase("lwt"))
      return FileType.Lwt;
    String str = MimeTypeMap.getSingleton().getMimeTypeFromExtension(paramFileInfo.type);
    if (str == null)
      return FileType.Others;
    if (str.toUpperCase().startsWith("AUDIO"))
      return FileType.Audio;
    if (str.toUpperCase().startsWith("VEDIO"))
      return FileType.Vedio;
    if (str.toUpperCase().startsWith("IMAGE"))
      return FileType.Image;
    return FileType.Doc;
  }

  public static enum FileType
  {
    static
    {
      Audio = new FileType("Audio", 2);
      Vedio = new FileType("Vedio", 3);
      Image = new FileType("Image", 4);
      Doc = new FileType("Doc", 5);
      Others = new FileType("Others", 6);
      FileType[] arrayOfFileType = new FileType[7];
      arrayOfFileType[0] = Apk;
      arrayOfFileType[1] = Lwt;
      arrayOfFileType[2] = Audio;
      arrayOfFileType[3] = Vedio;
      arrayOfFileType[4] = Image;
      arrayOfFileType[5] = Doc;
      arrayOfFileType[6] = Others;
      ENUM$VALUES = arrayOfFileType;
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.beans.FileInfoUtil
 * JD-Core Version:    0.5.2
 */